1. Field of the Invention
Methods and apparatuses consistent with the present invention relate to encoding and decoding based on inter prediction, and more particularly, to performing inter prediction so as to minimize a residue of a current block that is to be encoded, and encoding and decoding the current block based on the result of performing inter prediction.
2. Description of the Related Art
In video compression methods, such as MPEG-1, MPEG-2, and MPEG-4 H.264/MPEG-4 Advanced Video Coding (AVC), a picture is divided into macroblocks in order to encode the picture. Next, each of the macroblocks is encoded using inter prediction and intra prediction. An optimal encoding mode is then selected in consideration of the data sizes of the encoded macroblocks and the extent of degradation of the original macroblocks, and the macroblocks are encoded according to the optimal coding mode.
In related art methods of encoding an image by using inter prediction, the image is compressed by removing temporal redundancies among pictures, and a representative example of the above methods is motion estimation-based encoding.
In the motion estimation-based encoding method, an image is encoded by estimating and compensating for the motion of a current picture by using one or more reference pictures. In this case, a reference block most similar to a current block is detected within a predetermined search range of the reference picture, using a predetermined evaluation function. If the similar reference block is detected, only a between the current block and the similar reference block in the reference picture is transmitted, thereby increasing the compression rate of data. Various-sized blocks, e.g., a 16×16 block, an 8×16, and an 8×8 block, may be used as the current block, which will be described in greater detail with reference to FIG. 1A.
FIG. 1A illustrates a related art inter prediction method. Referring to FIG. 1A, inter prediction is performed using a reference picture in order to encode or decode an image.
In order to perform inter prediction on a current block 112 (an object of encoding) of a current picture 110, a video encoding apparatus detects a reference block 122 most similar to the current block 112 from a reference picture 120. Here, the reference block 122 is a block that is most appropriate for predicting the current block 112, and thus, a block having the smallest residue with the current block 112 may be selected as the reference block 122.
The reference block 122 is used as a prediction value of the current block 112, and thus, only the residue between the pixel values of the current block 112 and the reference block 122 is encoded in order to generate a bitstream. In this case, the distance between the location of the current block 112 in the current picture 110 and the location of reference block 122 is determined to be a motion vector 130. Information regarding the motion vector 130 is inserted into the overhead of the bitstream that is to be transmitted. Since only the residue is transmitted in order to increase the rate of video compression, the smaller the residue, the greater the rate of video compression.
In intra prediction, a reference picture is not used to encode a current block in a current picture. Rather, a prediction value of the current block is calculated using a previously encoded region of the current picture. An intra prediction mode is classified into a 4×4 intra prediction mode, an 8×8 intra prediction mode, and a 16×16 intra prediction mode according to luminance components, and an intra prediction mode according to chrominance components.
FIG. 1B illustrates a related art intra prediction method. Referring to FIG. 1B, for video encoding/decoding, intra prediction is performed using a previously encoded region 142 of a current picture 140.
A prediction value of a current block 146 is generated using pixels 148, adjacent to the current block 146, which are included in the previously encoded region 142. Intra prediction is performed on the current block 146 in various intra prediction modes, that is, in units of various sizes and in various intra prediction directions, and the prediction value of the current block 146 is generated according to an optimal intra prediction mode selected from among the various intra prediction modes. After generating the prediction value, only the residue between a pixel value of the current block 146 and a prediction value is encoded, thereby increasing the compression rate of video encoding.
As described above with reference to FIGS. 1A and 1B, in order to reduce the amount of information that is to be encoded, both inter prediction-based encoding and intra prediction-based encoding respectively include performing inter prediction and intra prediction so as to obtain a prediction value of a current block, generating only a residue from the prediction value, and encoding and transmitting the residue. That is, if the residue of the current block can be significantly reduced, the compression rate of video encoding is increased accordingly.